function ProductRetouchMagazine() {
};

ProductRetouchMagazine.instance = function(callbackFunc) {
  var popupBox = new PopupBox(), _self = this;
  var popupBox2 = new PopupBox2();
  var model = Model.instance('{{$smarty.const.MODEL_NAME_PRODUCT_RETOUCH_MAGAZINE|escape:javascript}}', '{{$smarty.const.MODEL_TITLE_PRODUCT_RETOUCH_MAGAZINE|escape:javascript}}', '{{$smarty.const.MODEL_TYPE_PRODUCT|escape:javascript}}');
  
  //Create model here...
  var state1 = State.instance(model, 0, 'not activate');
  var state2 = State.instance(model, 1, 'receive CUS photo requirement');
  var state3 = State.instance(model, 2, 'arrange designer');
  var state4 = State.instance(model, 3, 'translate and upload CUS requirement');
  var state5 = State.instance(model, 4, 'download CUS requirement and select photos');
  var state6 = State.instance(model, 5, 'completed and upload design');
  var state7 = State.instance(model, 6, 'check and sent design Draft to CUS');
  var state8 = State.instance(model, 7, 'receive CUS feedback');
  var state9 = State.instance(model, 8, 'check CUS feedback');
  var state10 = State.instance(model, 9, 'translate and upload CUS requirement');
  var state11 = State.instance(model, 10, 'download CUS requirement');
  var state12 = State.instance(model, 11, 'upload design (HD)');
  var state13 = State.instance(model, 12, 'download design (HD)');
  var state14 = State.instance(model, 13, 'print design');
  var state15 = State.instance(model, 14, 'complete product');
  var state16 = State.instance(model, 15, 'package and deliver product');
  var state17 = State.instance(model, 16, 'receive product');
  var state18 = State.instance(model, 17, 'CUS pick up product');
  var state19 = State.instance(model, 18, 'CUS picked up product');
  var state20 = State.instance(model, 19, 'solve CUS problem');
  var state21 = State.instance(model, 20, 'complete product');
  var transition1 = Transition.instance('received', state2, state3, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition2 = Transition.instance('rmd CUS', state2, state2, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.mixed, 30);
  var transition3 = Transition.instance('arrange', state3, state4, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition4 = Transition.instance('uploaded', state4, state5, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition5 = Transition.instance('downloaded', state5, state6, '{{$smarty.const.USER_TYPE_DESIGNER|escape:javascript}}', DlmanageUtils.normal, 9);
  var transition6 = Transition.instance('uploaded', state6, state7, '{{$smarty.const.USER_TYPE_DESIGNER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition7 = Transition.instance('sent', state7, state8, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 14);
  var transition8 = Transition.instance('received', state8, state9, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition9 = Transition.instance('rmd CUS', state8, state8, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition10 = Transition.instance('confirmed', state9, state12, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition11 = Transition.instance('modify', state9, state10, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition12 = Transition.instance('uploaded', state10, state11, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition13 = Transition.instance('downloaded', state11, state6, '{{$smarty.const.USER_TYPE_DESIGNER|escape:javascript}}', DlmanageUtils.normal, 9);
  var transition14 = Transition.instance('uploaded', state12, state13, '{{$smarty.const.USER_TYPE_DESIGNER|escape:javascript}}', DlmanageUtils.normal, 2);
  var transition15 = Transition.instance('downloaded', state13, state14, '{{$smarty.const.USER_TYPE_FACTORY|escape:javascript}}', DlmanageUtils.normal, 2);
  var transition16 = Transition.instance('printed', state14, state15, '{{$smarty.const.USER_TYPE_FACTORY|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition17 = Transition.instance('completed', state15, state16, '{{$smarty.const.USER_TYPE_FACTORY|escape:javascript}}', DlmanageUtils.normal, 4);
  var transition18 = Transition.instance('sent', state16, state17, '{{$smarty.const.USER_TYPE_FACTORY|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition19 = Transition.instance('received', state17, state18, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition20 = Transition.instance('pick up', state18, state19, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 9999);
  var transition21 = Transition.instance('rmd CUS', state18, state18, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition22 = Transition.instance('product fault report', state19, state20, '{{$smarty.const.USER_TYPE_MANAGER_ASSISTANT|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition23 = Transition.instance('completed', state20, state18, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 7);
  
  var transition24 = Transition.instance('received', state8, state9, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition25 = Transition.instance('rmd CUS', state8, state8, '{{$smarty.const.USER_TYPE_CUSTOMER_SERVICE|escape:javascript}}', DlmanageUtils.mixed, 7);
  
  var transition26 = Transition.instance('received', state2, state3, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition27 = Transition.instance('rmd CUS', state2, state2, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.mixed, 30);
  var transition28 = Transition.instance('arrange', state3, state4, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition29 = Transition.instance('uploaded', state4, state5, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition30 = Transition.instance('downloaded', state5, state6, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 9);
  var transition31 = Transition.instance('uploaded', state6, state7, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition32 = Transition.instance('sent', state7, state8, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 14);
  var transition33 = Transition.instance('received', state8, state9, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition34 = Transition.instance('rmd CUS', state8, state8, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition35 = Transition.instance('confirmed', state9, state12, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition36 = Transition.instance('modify', state9, state10, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition37 = Transition.instance('uploaded', state10, state11, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition38 = Transition.instance('downloaded', state11, state6, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 9);
  var transition39 = Transition.instance('uploaded', state12, state13, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 2);
  var transition40 = Transition.instance('downloaded', state13, state14, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 2);
  var transition41 = Transition.instance('printed', state14, state15, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition42 = Transition.instance('completed', state15, state16, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 4);
  var transition43 = Transition.instance('sent', state16, state17, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition44 = Transition.instance('received', state17, state18, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition45 = Transition.instance('pick up', state18, state19, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 9999);
  var transition46 = Transition.instance('rmd CUS', state18, state18, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition47 = Transition.instance('product fault report', state19, state20, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition48 = Transition.instance('completed', state20, state18, '{{$smarty.const.USER_TYPE_MANAGER|escape:javascript}}', DlmanageUtils.normal, 7);
  
  var transition49 = Transition.instance('received', state2, state3, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition50 = Transition.instance('rmd CUS', state2, state2, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.mixed, 30);
  var transition51 = Transition.instance('arrange', state3, state4, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition52 = Transition.instance('uploaded', state4, state5, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition53 = Transition.instance('downloaded', state5, state6, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 9);
  var transition54 = Transition.instance('uploaded', state6, state7, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition55 = Transition.instance('sent', state7, state8, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 14);
  var transition56 = Transition.instance('received', state8, state9, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition57 = Transition.instance('rmd CUS', state8, state8, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition58 = Transition.instance('confirmed', state9, state12, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition59 = Transition.instance('modify', state9, state10, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 0);
  var transition60 = Transition.instance('uploaded', state10, state11, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 1);
  var transition61 = Transition.instance('downloaded', state11, state6, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 9);
  var transition62 = Transition.instance('uploaded', state12, state13, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 2);
  var transition63 = Transition.instance('downloaded', state13, state14, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 2);
  var transition64 = Transition.instance('printed', state14, state15, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 3);
  var transition65 = Transition.instance('completed', state15, state16, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 4);
  var transition66 = Transition.instance('sent', state16, state17, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition67 = Transition.instance('received', state17, state18, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 7);
  var transition68 = Transition.instance('pick up', state18, state19, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 9999);
  var transition69 = Transition.instance('rmd CUS', state18, state18, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.mixed, 7);
  var transition70 = Transition.instance('product fault report', state19, state20, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 5);
  var transition71 = Transition.instance('completed', state20, state18, '{{$smarty.const.USER_TYPE_ADMIN|escape:javascript}}', DlmanageUtils.normal, 7);
  
  transition2.validate = function(produce, user, date, options) { if (transition2.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  transition9.validate = function(produce, user, date, options) { if (transition9.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  transition18.validate = function(produce, user, date, options) { return false; };
  transition19.validate = function(produce, user, date, options) { return false; };
  transition21.validate = function(produce, user, date, options) { if (transition21.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  
  transition25.validate = function(produce, user, date, options) { if (transition25.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  
  transition27.validate = function(produce, user, date, options) { if (transition27.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  transition34.validate = function(produce, user, date, options) { if (transition34.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  transition43.validate = function(produce, user, date, options) { return false; };
  transition44.validate = function(produce, user, date, options) { return false; };
  transition46.validate = function(produce, user, date, options) { if (transition46.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  
  transition50.validate = function(produce, user, date, options) { if (transition50.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  transition57.validate = function(produce, user, date, options) { if (transition57.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  transition66.validate = function(produce, user, date, options) { return false; };
  transition67.validate = function(produce, user, date, options) { return false; };
  transition69.validate = function(produce, user, date, options) { if (transition69.position != user.type) { return false; } if (SimpleDate.toStamp(date) < SimpleDate.toStamp(produce.deadline)) { return false; } else { return true; } };
  
  transition1.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    var div = document.createElement('div');
                                                                                    var func1 = function() { if (produce._method == '') {
                                                                                                               window.alert('CAN NOT BE EMPTY');
                                                                                                               return;
                                                                                                             }
                                                                                                             if (!options) {
                                                                                                               options = {};
                                                                                                             }
                                                                                                             options.extra = produce._method;
                                                                                                             DlmanageUtils.operate(transition1, pos, callbackFunc, produce, user, date, options);
                                                                                                             popupBox2._close();
                                                                                                           };
                                                                                    var func2 = function() { popupBox2._close();
                                                                                                             callbackFunc();
                                                                                                           };
                                                                                    MiscUtils.dialog(popupBox2, pos, div, func1, func2, { t: 'Method', width: 520, height: 80, func: func2});
                                                                                    new DialogMethod(div, produce, null);
                                                                                  };
  
  transition3.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    var div = document.createElement('div');
                                                                                    var func1 = function() { if (!options) {
                                                                                                               options = {};
                                                                                                             }
                                                                                                             if (produce.user_account == '') {
                                                                                                               window.alert('选择一个设计师');
                                                                                                               return;
                                                                                                             }
                                                                                                             options.extra = produce.user_account;
                                                                                                             DlmanageUtils.operate(transition3, pos, callbackFunc, produce, user, date, options);
                                                                                                             popupBox._close();
                                                                                                           };
                                                                                    var func2 = function() { popupBox._close();
                                                                                                             callbackFunc();
                                                                                                           };
                                                                                    MiscUtils.dialog(popupBox, pos, div, func1, func2);
                                                                                    new DialogAssignee(div, produce, { php: '{{$smarty.const.FACTORY|escape:javascript}}/customphp/mysqlread.php', condition: 'd.type = \'{{$smarty.const.USER_TYPE_DESIGNER|escape:javascript}}\'' });
                                                                                  };
  
  transition8.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    var div = document.createElement('div');
                                                                                    var func1 = function() { if (produce._method == '') {
                                                                                                              window.alert('CAN NOT BE EMPTY');
                                                                                                              return;
                                                                                                            }
                                                                                                            if (!options) {
                                                                                                              options = {};
                                                                                                            }
                                                                                                            options.extra = produce._method;
                                                                                                            DlmanageUtils.operate(transition8, pos, callbackFunc, produce, user, date, options);
                                                                                                            popupBox2._close();
                                                                                                          };
                                                                                    var func2 = function() { popupBox2._close();
                                                                                                             callbackFunc();
                                                                                                           };
                                                                                    MiscUtils.dialog(popupBox2, pos, div, func1, func2, { t: 'Method', width: 520, height: 80, func: func2});
                                                                                    new DialogMethod(div, produce, null);
                                                                                  };
  
  transition10.operate = function(pos, callbackFunc, produce, user, date, options) { var tmp = window.confirm('请确认已经“上传小样”,是否继续？');
                                                                                     if (tmp) {
                                                                                       DlmanageUtils.operate(transition10, pos, callbackFunc, produce, user, date, options);
                                                                                     } else {
                                                                                       callbackFunc();
                                                                                     }
                                                                                   };
  
  transition11.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     produce.modified = 1;
                                                                                     DlmanageUtils.operate(transition11, pos, callbackFunc, produce, user, date, options);
                                                                                   };
  
  transition20.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     options.stage = 4; 
                                                                                     options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                     DlmanageUtils.operate3(transition20, pos, callbackFunc, produce, user, date, options);
                                                                                   };
  
  transition24.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     var div = document.createElement('div');
                                                                                     var func1 = function() { if (produce._method == '') {
                                                                                                                window.alert('CAN NOT BE EMPTY');
                                                                                                                return;
                                                                                                              }
                                                                                                              if (!options) {
                                                                                                                options = {};
                                                                                                              }
                                                                                                              options.extra = produce._method;
                                                                                                              DlmanageUtils.operate(transition24, pos, callbackFunc, produce, user, date, options);
                                                                                                              popupBox2._close();
                                                                                                            };
                                                                                     var func2 = function() { popupBox2._close();
                                                                                                              callbackFunc();
                                                                                                            };
                                                                                     MiscUtils.dialog(popupBox2, pos, div, func1, func2, { t: 'Method', width: 520, height: 80, func: func2});
                                                                                     new DialogMethod(div, produce, null);
                                                                                   };
  
  transition26.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     var div = document.createElement('div');
                                                                                     var func1 = function() { if (produce._method == '') {
                                                                                                                window.alert('CAN NOT BE EMPTY');
                                                                                                                return;
                                                                                                              }
                                                                                                              if (!options) {
                                                                                                                options = {};
                                                                                                              }
                                                                                                              options.extra = produce._method;
                                                                                                              DlmanageUtils.operate(transition26, pos, callbackFunc, produce, user, date, options);
                                                                                                              popupBox2._close();
                                                                                                            };
                                                                                     var func2 = function() { popupBox2._close();
                                                                                                              callbackFunc();
                                                                                                            };
                                                                                     MiscUtils.dialog(popupBox2, pos, div, func1, func2, { t: 'Method', width: 520, height: 80, func: func2});
                                                                                     new DialogMethod(div, produce, null);
                                                                                   };
 
  transition28.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     var div = document.createElement('div');
                                                                                     var func1 = function() { if (!options) {
                                                                                                                options = {};
                                                                                                              }
                                                                                                              if (produce.user_account == '') {
                                                                                                                window.alert('选择一个设计师');
                                                                                                                return;
                                                                                                              }
                                                                                                              options.extra = produce.user_account;
                                                                                                              DlmanageUtils.operate(transition28, pos, callbackFunc, produce, user, date, options);
                                                                                                              popupBox._close();
                                                                                                            };
                                                                                     var func2 = function() { popupBox._close();
                                                                                                              callbackFunc();
                                                                                                            };
                                                                                     MiscUtils.dialog(popupBox, pos, div, func1, func2);
                                                                                     new DialogAssignee(div, produce, { php: '{{$smarty.const.FACTORY|escape:javascript}}/customphp/mysqlread.php', condition: 'd.type = \'{{$smarty.const.USER_TYPE_DESIGNER|escape:javascript}}\'' });
                                                                                   };
 
  transition33.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     var div = document.createElement('div');
                                                                                     var func1 = function() { if (produce._method == '') {
                                                                                                               window.alert('CAN NOT BE EMPTY');
                                                                                                               return;
                                                                                                             }
                                                                                                             if (!options) {
                                                                                                               options = {};
                                                                                                             }
                                                                                                             options.extra = produce._method;
                                                                                                             DlmanageUtils.operate(transition33, pos, callbackFunc, produce, user, date, options);
                                                                                                             popupBox2._close();
                                                                                                           };
                                                                                     var func2 = function() { popupBox2._close();
                                                                                                              callbackFunc();
                                                                                                            };
                                                                                     MiscUtils.dialog(popupBox2, pos, div, func1, func2, { t: 'Method', width: 520, height: 80, func: func2});
                                                                                     new DialogMethod(div, produce, null);
                                                                                   };
 
  transition35.operate = function(pos, callbackFunc, produce, user, date, options) { var tmp = window.confirm('请确认已经“上传小样”,是否继续？');
                                                                                     if (tmp) {
                                                                                       DlmanageUtils.operate(transition35, pos, callbackFunc, produce, user, date, options);
                                                                                     } else {
                                                                                       callbackFunc();
                                                                                     }
                                                                                   };
 
  transition36.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                       options = {};
                                                                                     }
                                                                                     var previous = MiscUtils.clone(produce);
                                                                                     options.previous = previous;
                                                                                     produce.modified = 1;
                                                                                     DlmanageUtils.operate(transition36, pos, callbackFunc, produce, user, date, options);
                                                                                   };
 
  transition45.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                      options = {};
                                                                                    }
                                                                                    var previous = MiscUtils.clone(produce);
                                                                                    options.previous = previous;
                                                                                    options.stage = 4; 
                                                                                    options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                    DlmanageUtils.operate3(transition45, pos, callbackFunc, produce, user, date, options);
                                                                                  };
transition49.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  var div = document.createElement('div');
                                                                                  var func1 = function() { if (produce._method == '') {
                                                                                                             window.alert('CAN NOT BE EMPTY');
                                                                                                             return;
                                                                                                           }
                                                                                                           if (!options) {
                                                                                                             options = {};
                                                                                                           }
                                                                                                           options.extra = produce._method;
                                                                                                           DlmanageUtils.operate(transition49, pos, callbackFunc, produce, user, date, options);
                                                                                                           popupBox2._close();
                                                                                                         };
                                                                                  var func2 = function() { popupBox2._close();
                                                                                                           callbackFunc();
                                                                                                         };
                                                                                  MiscUtils.dialog(popupBox2, pos, div, func1, func2, { t: 'Method', width: 520, height: 80, func: func2});
                                                                                  new DialogMethod(div, produce, null);
                                                                                };

transition51.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  var div = document.createElement('div');
                                                                                  var func1 = function() { if (!options) {
                                                                                                             options = {};
                                                                                                           }
                                                                                                           if (produce.user_account == '') {
                                                                                                             window.alert('选择一个设计师');
                                                                                                             return;
                                                                                                           }
                                                                                                           options.extra = produce.user_account;
                                                                                                           DlmanageUtils.operate(transition51, pos, callbackFunc, produce, user, date, options);
                                                                                                           popupBox._close();
                                                                                                         };
                                                                                  var func2 = function() { popupBox._close();
                                                                                                           callbackFunc();
                                                                                                         };
                                                                                  MiscUtils.dialog(popupBox, pos, div, func1, func2);
                                                                                  new DialogAssignee(div, produce, { php: '{{$smarty.const.FACTORY|escape:javascript}}/customphp/mysqlread.php', condition: 'd.type = \'{{$smarty.const.USER_TYPE_DESIGNER|escape:javascript}}\'' });
                                                                                };

transition56.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  var div = document.createElement('div');
                                                                                  var func1 = function() { if (produce._method == '') {
                                                                                                            window.alert('CAN NOT BE EMPTY');
                                                                                                            return;
                                                                                                          }
                                                                                                          if (!options) {
                                                                                                            options = {};
                                                                                                          }
                                                                                                          options.extra = produce._method;
                                                                                                          DlmanageUtils.operate(transition56, pos, callbackFunc, produce, user, date, options);
                                                                                                          popupBox2._close();
                                                                                                        };
                                                                                  var func2 = function() { popupBox2._close();
                                                                                                           callbackFunc();
                                                                                                         };
                                                                                  MiscUtils.dialog(popupBox2, pos, div, func1, func2, { t: 'Method', width: 520, height: 80, func: func2});
                                                                                  new DialogMethod(div, produce, null);
                                                                                };

transition58.operate = function(pos, callbackFunc, produce, user, date, options) { var tmp = window.confirm('请确认已经“上传小样”,是否继续？');
                                                                                  if (tmp) {
                                                                                    DlmanageUtils.operate(transition58, pos, callbackFunc, produce, user, date, options);
                                                                                  } else {
                                                                                    callbackFunc();
                                                                                  }
                                                                                };

transition59.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                    options = {};
                                                                                  }
                                                                                  var previous = MiscUtils.clone(produce);
                                                                                  options.previous = previous;
                                                                                  produce.modified = 1;
                                                                                  DlmanageUtils.operate(transition59, pos, callbackFunc, produce, user, date, options);
                                                                                };

transition68.operate = function(pos, callbackFunc, produce, user, date, options) { if (!options) {
                                                                                   options = {};
                                                                                 }
                                                                                 var previous = MiscUtils.clone(produce);
                                                                                 options.previous = previous;
                                                                                 options.stage = 4; 
                                                                                 options.func = function(div, customer, options) { new DialogLocation(div, customer, options); };
                                                                                 DlmanageUtils.operate3(transition68, pos, callbackFunc, produce, user, date, options);
                                                                               };
  model.states = [ state1, state2, state3, state4, state5, state6, state7, state8, state9, state10, state11, state12, state13, state14, state15, state16, state17, state18, state19, state20, state21 ];
  model.transitions = [ transition1, transition2, transition3, transition4, transition5, transition6, transition7, transition8, transition9, transition10, transition11, transition12, transition13, transition14, transition15, transition16, transition17, transition18, transition19, transition20, 
                        transition21, transition22, transition23, transition24, transition25, transition26, transition27, transition28, transition29, transition30, transition31, transition32, transition33, transition34, transition35, transition36, transition37, transition38, transition39, transition40, 
                        transition41, transition42, transition43, transition44, transition45, transition46, transition47, transition48, transition49, transition50, transition51, transition52, transition53, transition54, transition55, transition56, transition57, transition58, transition59, transition60,
                        transition61, transition62, transition63, transition64, transition65, transition66, transition67, transition68, transition69, transition70, transition71 ];
  return model;
};